import pandas as pd
import sqlite3
import plotly
import plotly.graph_objects as px
df = pd.ExcelFile("EV_Registered_Data.xlsx")
print(df.sheet_names)
['Australia', 'China', 'Canada', 'Europe', 'United States', 'Latin America', 'Totals']
dfAustralia = pd.read_excel(df, 'Australia')
dfChina = pd.read_excel(df, 'China')
dfCanada = pd.read_excel(df, 'Canada')
dfEurope = pd.read_excel(df, 'Europe')
dfUS = pd.read_excel(df, 'United States')
dfLA = pd.read_excel(df, 'Latin America')
dfTotals = pd.read_excel(df, 'Totals')
print(dfAustralia)
print(dfChina)
print(dfCanada)
print(dfEurope)
print(dfUS)
print(dfLA)
print(dfTotals)
State # of EV registrations \
0 New South Wales 10026
1 Victoria 10311
2 Queensland 8000
3 South Australia 200
4 Australian Capital Territory 1304
5 Western Australia 1501
6 Tasmania 340
7 Northern Territory 61
Percent of total EVs (Approx.)
0 0.3158
1 0.3248
2 0.2520
3 0.0063
4 0.0411
5 0.0473
6 0.0107
7 0.0019
Country # of EV registrations Percent of total EVs (Approx.)
0 China 2500000 1
Country # of EV registrations Percent of total EVs (Approx.)
0 Canada 54353 1
Country # of EV registrations Percent of total EVs (Approx.)
0 Austria 24143 0.0301
1 Belgium 15296 0.0191
2 Bulgaria 219 0.0003
3 Croatia 738 0.0009
4 Cyprus 64 0.0001
5 Czech Republic 1825 0.0023
6 Denmark 15014 0.0187
7 Estonia 363 0.0005
8 Finland 6422 0.0080
9 France 106945 0.1335
10 Germany 237057 0.2959
11 Greece 1489 0.0019
12 Hungary 2326 0.0029
13 Iceland 2359 0.0029
14 Ireland 7820 0.0098
15 Italy 47072 0.0588
16 Latvia 291 0.0004
17 Lithuania 583 0.0007
18 Luxembourg 3093 0.0039
19 Netherlands 29924 0.0374
20 Norway 80588 0.1006
21 Poland 4096 0.0051
22 Portugal 7839 0.0098
23 Romania 1914 0.0024
24 Slovakia 715 0.0009
25 Slovenia 1133 0.0014
26 Spain 15033 0.0188
27 Sweden 37402 0.0467
28 Switzerland 24151 0.0301
29 United Kingdom 125141 0.1562
State # of EV registrations \
0 Alabama 2890
1 Alaska 940
2 Arizona 28770
3 Arkansas 1330
4 California 425300
5 Colorado 24670
6 Connecticut 9040
7 Delaware 1950
8 District of Columbia 2360
9 Florida 58160
10 Georgia 23530
11 Hawaii 10670
12 Idaho 2300
13 Illinois 26000
14 Indiana 6990
15 Iowa 2260
16 Kansas 3130
17 Kentucky 2650
18 Louisiana 1950
19 Maine 1920
20 Maryland 17970
21 Massachusetts 21010
22 Michigan 10620
23 Minnesota 10380
24 Mississippi 780
25 Missouri 6740
26 Montana 940
27 Nebraska 1810
28 Nevada 11040
29 New Hampshire 2690
30 New Jersey 30420
31 New Mexico 2620
32 New York 32590
33 North Carolina 16190
34 North Dakota 220
35 Ohio 14530
36 Oklahoma 3410
37 Oregon 22850
38 Pennsylvania 17530
39 Rhode Island 1580
40 South Carolina 4390
41 South Dakota 410
42 Tennessee 7810
43 Texas 52190
44 Utah 11230
45 Vermont 2230
46 Virginia 20510
47 Washington 50520
48 West Virginia 600
49 Wisconsin 6310
50 Wyoming 330
Percent of total EVs (Approx.)
0 0.0030
1 0.0009
2 0.0280
3 0.0013
4 0.4200
5 0.0240
6 0.0090
7 0.0020
8 0.0023
9 0.0570
10 0.0230
11 0.0110
12 0.0023
13 0.0260
14 0.0070
15 0.0022
16 0.0031
17 0.0026
18 0.0019
19 0.0019
20 0.0180
21 0.0210
22 0.0100
23 0.0100
24 0.0008
25 0.0066
26 0.0009
27 0.0018
28 0.0110
29 0.0026
30 0.0300
31 0.0026
32 0.0320
33 0.0160
34 0.0002
35 0.0140
36 0.0034
37 0.0220
38 0.0170
39 0.0016
40 0.0043
41 0.0004
42 0.0080
43 0.0510
44 0.0110
45 0.0022
46 0.0200
47 0.0500
48 0.0006
49 0.0062
50 0.0003
State # of EV registrations Percent of total EVs (Approx.)
0 Argentina 100 0.0093
1 Barbados 430 0.0398
2 Bermudas 430 0.0398
3 Bolivia 275 0.0255
4 Brazil 1000 0.0927
5 Cayman Islands 160 0.0148
6 Chile 581 0.0538
7 Colombia 3334 0.3100
8 Costa Rica 1738 0.1610
9 Dominican Republic 472 0.0437
10 Ecuador 571 0.0529
11 El Salvador 2 0.0002
12 Guatemala 260 0.0241
13 Jamaica 20 0.0018
14 Mexico 449 0.0416
15 Panama 20 0.0018
16 Paraguay 300 0.0278
17 Peru 346 0.0321
18 Uruguay 303 0.0281
Location # of EV registrations
0 Australia 31743
1 China 2500000
2 Canada 54353
3 Europe 801055
4 United States 1019260
5 Latin America 10791
barAustralia = [px.Bar(x=dfAustralia['State'], y=dfAustralia['# of EV registrations'])]
print("Distribution of EVs in Australia")
fig = px.Figure(barAustralia)
fig.show()
Distribution of EVs in Australia
barEurope = [px.Bar(x=dfEurope['Country'], y=dfEurope['# of EV registrations'])]
print("Distribution of EVs in Europe")
fig = px.Figure(barEurope)
fig.show()
Distribution of EVs in Europe
barUS = [px.Bar(x=dfUS['State'], y=dfUS['# of EV registrations'])]
print("Distribution of EVs in US")
fig = px.Figure(barUS)
fig.show()
Distribution of EVs in US
barLA = [px.Bar(x=dfLA['State'], y=dfLA['# of EV registrations'])]
print("Distribution of EVs in LA")
fig = px.Figure(barLA)
fig.show()
Distribution of EVs in LA
barTotals = [px.Bar(x=dfTotals['Location'], y=dfTotals['# of EV registrations'])]
print("Distribution of EVs Worldwide")
fig = px.Figure(barTotals)
fig.show()
Distribution of EVs Worldwide